import request from '@/axios/request'
import url from '@/axios/url'
const { mesUrl } = url()

/**
 * 新增
 * @param data
 * @returns {*|Promise<*>}
 */
export function mesTmMaterialBrandCreate(data = {}) {
  return request({
    url: `${mesUrl}mesTmMaterialBrand/save`,
    method: 'post',
    data: data
  })
}

/**
 * 修改
 * @param data
 * @returns {*|Promise<*>}
 */
export function mesTmMaterialBrandUpdate(data = {}) {
  return request({
    url: `${mesUrl}mesTmMaterialBrand/update`,
    method: 'put',
    data: data
  })
}

/**
 * 分页
 * @param data
 * @returns {*|Promise<*>}
 */
export function mesTmMaterialBrandPage(data = {}) {
  return request({
    url: `${mesUrl}mesTmMaterialBrand/page`,
    method: 'get',
    params: data
  })
}

/**
 * 删除
 * @param id
 * @returns {*|Promise<*>}
 */
export function mesTmMaterialBrandDeleteById(ids = '') {
  return request({
    url: `${mesUrl}mesTmMaterialBrand/delete/${ids}`,
    method: 'delete'
  })
}

export function mesTmMaterialBrands(code = '') {
  return request({
    url: `${mesUrl}mesTmMaterialBrand/brands/${code}`,
    method: 'get'
  })
}
